import http from '../../../util/http.js';


const LefuCasePrefix = "/lefu/case";


//车辆分类列表
export function caseFind(id) {
    let url = `${LefuCasePrefix}/find/${id}`;
    return new Promise((resolve, reject) => {
        http.get(url).then(response => {
            resolve(response)
        });
    });
}


export function caseList(pagination, param) {
    let url = `${LefuCasePrefix}/list/${pagination.pageSize}/${pagination.current}`;
    return new Promise((resolve, reject) => {
        http.get(url, param).then(response => {
            resolve(response)
        });
    });
}


export function caseAdd(data) {
    let url = `${LefuCasePrefix}/add`;
    return new Promise((resolve, reject) => {
        http.post(url, data).then(response => {
            resolve(response)
        });
    });
}


export function caseUpdate(id, data) {
    let url = `${LefuCasePrefix}/update/${id}`;
    return new Promise((resolve, reject) => {
        http.put(url, data).then(response => {
            resolve(response)
        });
    });
}


export function caseDelete(id) {
    let url = `${LefuCasePrefix}/delete/${id}`;
    return new Promise((resolve, reject) => {
        http.delete(url).then(response => {
            resolve(response)
        });
    });
}


//=============================线索====================


const LefuCluesPrefix = "/lefu/clues";

export function cluesList(pagination, param) {
    let url = `${LefuCluesPrefix}/list/${pagination.pageSize}/${pagination.current}`;
    return new Promise((resolve, reject) => {
        http.get(url, param).then(response => {
            resolve(response)
        });
    });
}


export function cluesAdd(data) {
    let url = `${LefuCluesPrefix}/add`;
    return new Promise((resolve, reject) => {
        http.post(url, data).then(response => {
            resolve(response)
        });
    });
}


export function cluesUpdate(id, data) {
    let url = `${LefuCluesPrefix}/update/${id}`;
    return new Promise((resolve, reject) => {
        http.put(url, data).then(response => {
            resolve(response)
        });
    });
}


export function cluesDelete(id) {
    let url = `${LefuCluesPrefix}/delete/${id}`;
    return new Promise((resolve, reject) => {
        http.delete(url).then(response => {
            resolve(response)
        });
    });
}
